import utime
import random
from neopixel import NeoPixel
from machine import Pin
import sys
# 级联的灯珠总数量
num_leds = 256
# 创建像素序列对象
np = NeoPixel(Pin(21, Pin.OUT), num_leds)
counter = 1
while True:
    for i in range(num_leds):
        r = random.randint(0, 255)
        g = random.randint(0, 255)
        b = random.randint(0, 255)
    
        np[i] = (r, g, b)  # (r,g,b)范围 0-255  255贼亮
        utime.sleep(0.01);
        np.write()
    utime.sleep(0.03)
    
    counter=counter+1
    if (counter>255):
        counter=0
    print(counter)
    print(sys.path)
